package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/hello/a")
@RestController//创建一个controller类，实现用户通过浏览器和程序的交互
public class HelloController {
    @RequestMapping(value = "/sayhi/b", method = RequestMethod.POST)
    public String sayHi() {
        return "hi,SpringBoot";
    }

    @RequestMapping("/sayhello")
    public String sayHello() {
        return "hello,SpringBoot";
    }

}
